/*
   Copyright 2011 James Bowling

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

package com.armedia.dctm.constraints.bo;

import com.armedia.dctm.constraints.Constants;
import com.armedia.dctm.constraints.module.ConstraintModule;
import com.documentum.com.DfClientX;
import com.documentum.com.IDfClientX;
import com.documentum.fc.client.DfPersistentObject;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.common.DfException;

public class ConstraintBOImpl extends DfPersistentObject implements ConstraintBO {

	public String getVendorString() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getVersion() {
		// TODO Auto-generated method stub
		return null;
	}

	public boolean isCompatible(String arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean supportsFeature(String arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	protected void doSave(boolean saveLock, String versionLabel, Object[] extendedArgs)
			throws DfException {
		IDfClientX cx = new DfClientX();
		IDfClient lc = cx.getLocalClient();		
		ConstraintModule constraintModule = (ConstraintModule) lc.newModule(getSession().getDocbaseName(), Constants.CONSTRAINT_MODULE_NAME, getSessionManager());
		constraintModule.check(this);		
		super.doSave(saveLock, versionLabel, extendedArgs);
	}

	@Override
	public void save() throws DfException {
		super.save();
	}

}
